﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CrossGenLogic
{
    public class GridElement
    {
        private bool ishorizontal;
        private int x, y;
        private int length;
        private int index;
        private List<int> intersection;
        private bool isfill;
        private VocElement VE;


        public GridElement(int x, int y, bool ishorizontal, int length)
        {
            this.x = x;
            this.y = y;
            this.ishorizontal = ishorizontal;
            this.length = length;
            this.isfill = false;
            intersection = new List<int>();
        }

        public int X
        {
            get
            {
                return x;
            }
        }

        public int Y
        {
            get
            {
                return y;
            }
        }

        public int Index
        {
            get
            {
                return index;
            }
            set
            {
                index = value;
            }

        }

        public int Length
        {
            get
            {
                return length;
            }
        }

        public bool IsFill
        {
            get
            {
                return isfill;
            }
            set
            {
                isfill = value;
            }
        }

        public VocElement Word
        {
            get
            {
                return VE;
            }
            set
            {
                VE = value;
            }
        }

        public int dx()
        {
            if (ishorizontal) return 1;
            else return 0;
        }

        public int dy()
        {
            if (ishorizontal) return 0;
            else return 1;
        }

        public List<int> GetIntersection()
        {
            return intersection;
        }

        public void AddIntersection(int i)
        {
            intersection.Add(i);
        }

        public int GetInterCount()
        {
            return intersection.Count;
        }
    }
}
